<%@ page import="com.example.oa.Employee" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2023/3/13 0013
  Time: 14:54
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>employee page</title>
</head>
<%--<%--%>
<%--    int role = (int) session.getAttribute("role");--%>
<%--    if (role != 0) {--%>
<%--        request.setAttribute("error", "Invalid visit.");--%>
<%--        request.getRequestDispatcher("index.jsp").forward(request, response);--%>
<%--    }--%>
<%--    %>--%>



<c:if test="${sessionScope.role ne 0}">
    <c:set var="error" scope="request" value="Invalid visit 1"/>
<%--<c:redirect url="index.jsp"/>--%>
    <jsp:forward page="index.jsp"/>
</c:if>
<body>
<h1>employee page</h1>

<h3>Welcome: ${sessionScope.employee.name}</h3>
${sessionScope.employee.id}
${sessionScope.employee.name}
${sessionScope.employee.age}
${sessionScope.employee.gender}
<a href="/employee?action=sign_out">Sign out </a>
</body>
</html>
